﻿package com.tudou.home.newskin.containers
{
    import com.tudou.home.common.button.*;
    import com.tudou.home.common.events.*;
    import com.tudou.home.newskin.events.*;
    import com.tudou.skin.*;

    public class PrevNextSprite extends PrevNextButton implements IPlayList
    {

        public function PrevNextSprite()
        {
            super(new PreviousItemBTN(), new PreviousItemDisableMC(), new NextItemBTN(), new NextItemDisableMC());
            addEventListener(PrevNextEvent.PREVIOUS, prevNextHlr);
            addEventListener(PrevNextEvent.NEXT, prevNextHlr);
            return;
        }// end function

        public function setPlayList(param1:Array) : void
        {
            if (param1)
            {
                setLength(param1.length);
            }
            return;
        }// end function

        private function prevNextHlr(event:PrevNextEvent) : void
        {
            var _loc_2:* = event.type == PrevNextEvent.NEXT ? ((event.index + 1)) : ((event.index - 1));
            dispatchEvent(new SkinEvent(SkinEvent.THIS_INDEX, _loc_2));
            return;
        }// end function

    }
}
